package material;

import detector.KeyboardDetector;
import detector.KeyboardDetectorImpl;

/**
 * Classe implementant l'interface Keyboard et travaillant par delegation sur un objet KeyboardDetector, un singleton qui propose le meme service de lecture
 * de l'etat des boutons mais qui autorise en plus la modification de ces etats.
 */
public class KeyboardImpl implements Keyboard {
	
	private KeyboardDetector keyboardDetector;	// Clavier "etendu" delegue
	
	public KeyboardImpl() {
		keyboardDetector = KeyboardDetectorImpl.keyboardDetectorInstance();
	}
	
	public boolean isButtonPressed(int buttonID) {
		return keyboardDetector.isButtonPressed(buttonID);
	}
	
}
